package top.greatxiaozou.diy;


import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

@Aspect
public class AnnotationPointCut {

    @Before("execution(* top.greatxiaozou.service.UserServiecImpl*.*(..))")
    public void before() {
        System.out.println("========方法执行前======");
    }

    @After("execution(* top.greatxiaozou.service.UserServiecImpl*.*(..))")
    public void after() {
        System.out.println("========方法执行后======");
    }

    @Around("execution(* top.greatxiaozou.service.UserServiecImpl*.*(..))")
    public void around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("=======环绕前=======");
        pjp.proceed();
        //获取被代理方法的签名和类
        System.out.println(pjp.getSignature());
        System.out.println(pjp.getTarget());
        System.out.println("======环绕后=======");

    }
}
